<%@page import="com.lynn.salary.util.ToolMethod"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
	String ai = ToolMethod.getCharAndNumr(5);
%>
<%@ taglib prefix="s" uri="/struts-tags" %>

<div>
为附件  ( <s:property value="accessory.name"/>  )  添加文件:
</div>
<div id="div-<%=ai%>" style="width: 400px;height: 200px;background-color: rgb(234,234,255); line-height: 25px;margin-top: 20px;">
	<div style="padding-left: 20px;padding-top: 10px;">已上传文件</div>
</div>
<form action="<%=basePath%>uploadFile!forAccessory.do" id="form1" name="form1" encType="multipart/form-data" method="post"
	target="hidden_frame">
	<input type="hidden" name="accessory.id" value="<s:property value='accessory.id'/>" />
	<input type="file" id="file" name="uploadFile" style="width:350"> 
	<INPUT type="submit" value="上传">
	<br>
	<div id="msg"></div>
	<br>
	<div style="color: blue">
		支持jpg,png,jpeg,bmp,rar,7z,tar,gz,zip,pptx,xlsx,txt,excel,ppt,pdf,doc,docx文件格式上传,上传文件名中请勿带空格!
		</div>
	<div style="color: red">	大文件或其他格式文件可采用压缩成分卷上传
	</div>
	<div style="color: red">
		限制文件大小60M
	</div>
</form>
	<iframe name='hidden_frame' id="hidden_frame" style="display: none;"></iframe>
<style>
	div {
		font-family: Arial, sans-serif;
	}
</style>
<script type="text/javascript">
	function callback(msg,fname) {
		if(fname != "") {
			document.getElementById("div-<%=ai%>").innerHTML += "<div style='padding-left:20px;margin-top:12px;'> "+fname+" </div>";
		}
		document.getElementById("file").outerHTML = document
				.getElementById("file").outerHTML;
		document.getElementById("msg").innerHTML = "<div style=\"color: red\">" + msg
				+ "</div>";
	}
</script>